package com.my.study.service.Impl;

import com.my.study.convert.LoginLogRequestConvert;
import com.my.study.dto.LoginLogDTO;
import com.my.study.mapper.LoginLogMapper;
import com.my.study.service.LoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class LoginLogServiceImpl implements LoginLogService {

    @Autowired
    private LoginLogMapper loginLogMapper;
    @Autowired
    private LoginLogRequestConvert loginLogRequestConvert;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int addLoginLog(LoginLogDTO loginLog) {
        return loginLogMapper.addLoginLog(loginLogRequestConvert.toEntity(loginLog));
    }
}
